package com.changeover.gwt.connection.dispatcher.server;

import javax.annotation.PostConstruct;

import net.customware.gwt.dispatch.server.DefaultActionHandlerRegistry;
import net.customware.gwt.dispatch.server.InstanceActionHandlerRegistry;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.changeover.handler.LoginHandler;

/**
 * The Handler Registry. It contains all server handlers for client requests
 * 
 * @author Roman Kostenko
 */
@Service("handlerRegistry")
public class HandlerRegistry implements IHandlerRegistry {

    private final InstanceActionHandlerRegistry registry = new DefaultActionHandlerRegistry();

    @Autowired
    private LoginHandler loginHandler;

    @PostConstruct
    public void register() {
        registry.addHandler(loginHandler);
    }

    @Override
    public InstanceActionHandlerRegistry getRegistry() {
        return registry;
    }

}
